/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2013
 */

package com.smg.community.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.smg.community.model.*;
import com.smg.community.dao.*;
import com.smg.community.service.*;
import com.smg.community.vo.query.*;

/**
 * @author badqiu email:badqiu(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


public class SmgMessage extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "SmgMessage";
	public static final String ALIAS_MID = "mid";
	public static final String ALIAS_MESSAGE_TITLE = "messageTitle";
	public static final String ALIAS_MESSAGE_CONT = "messageCont";
	public static final String ALIAS_FROM_MEMBER_ID = "fromMemberId";
	public static final String ALIAS_FROM_MEMBER_HEAD_IMAGE = "fromMemberHeadImage";
	public static final String ALIAS_FROM_MEMBER_NICK_NAME = "fromMemberNickName";
	public static final String ALIAS_TO_MEMBER_ID = "toMemberId";
	public static final String ALIAS_TO_MEMBER_HEAD_IMAGE = "toMemberHeadImage";
	public static final String ALIAS_TO_MEMBER_NICK_NAME = "toMemberNickName";
	public static final String ALIAS_FROM_IS_VALID = "fromIsValid";
	public static final String ALIAS_TO_IS_VALID = "toIsValid";
	public static final String ALIAS_SEND_DATE = "sendDate";
	public static final String ALIAS_IS_READ = "isRead";
	public static final String ALIAS_MESSAGE_TYPE = "messageType";
	public static final String ALIAS_ACTION_TYPE = "actionType";
	
	//date formats
	public static final String FORMAT_SEND_DATE = DATE_FORMAT;
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * mid       db_column: mid 
     */	
	
	private java.lang.Integer mid;
    /**
     * messageTitle       db_column: messageTitle 
     */	
	private java.lang.String messageTitle;
    /**
     * messageCont       db_column: messageCont 
     */	
	private java.lang.String messageCont;
    /**
     * fromMemberId       db_column: fromMemberId 
     */	
	
	private java.lang.Integer fromMemberId;
    /**
     * fromMemberHeadImage       db_column: fromMemberHeadImage 
     */	
	private java.lang.String fromMemberHeadImage;
    /**
     * fromMemberNickName       db_column: fromMemberNickName 
     */	
	private java.lang.String fromMemberNickName;
    /**
     * toMemberId       db_column: toMemberId 
     */	
	
	private java.lang.Integer toMemberId;
    /**
     * toMemberHeadImage       db_column: toMemberHeadImage 
     */	
	private java.lang.String toMemberHeadImage;
    /**
     * toMemberNickName       db_column: toMemberNickName 
     */	
	private java.lang.String toMemberNickName;
    /**
     * fromIsValid       db_column: fromIsValid 
     */	
	
	private java.lang.Integer fromIsValid;
    /**
     * toIsValid       db_column: toIsValid 
     */	
	
	private java.lang.Integer toIsValid;
    /**
     * sendDate       db_column: sendDate 
     */	
	
	private java.util.Date sendDate;
    /**
     * isRead       db_column: isRead 
     */	
	
	private java.lang.Integer isRead;
    /**
     * messageType       db_column: messageType 
     */	
	
	private java.lang.Integer messageType;
    /**
     * actionType       db_column: actionType 
     */	
	
	private java.lang.Integer actionType;
	//columns END
	private int isDeal;
	
	private String actionResult;
	public int getIsDeal() {
		return isDeal;
	}

	public void setIsDeal(int isDeal) {
		this.isDeal = isDeal;
	}

	public String getActionResult() {
		return actionResult;
	}

	public void setActionResult(String actionResult) {
		this.actionResult = actionResult;
	}

	public SmgMessage(){
	}

	public SmgMessage(
		java.lang.Integer mid
	){
		this.mid = mid;
	}

	public void setMid(java.lang.Integer value) {
		this.mid = value;
	}
	
	public java.lang.Integer getMid() {
		return this.mid;
	}
	public void setMessageTitle(java.lang.String value) {
		this.messageTitle = value;
	}
	
	public java.lang.String getMessageTitle() {
		return this.messageTitle;
	}
	public void setMessageCont(java.lang.String value) {
		this.messageCont = value;
	}
	
	public java.lang.String getMessageCont() {
		return this.messageCont;
	}
	public void setFromMemberId(java.lang.Integer value) {
		this.fromMemberId = value;
	}
	
	public java.lang.Integer getFromMemberId() {
		return this.fromMemberId;
	}
	public void setFromMemberHeadImage(java.lang.String value) {
		this.fromMemberHeadImage = value;
	}
	
	public java.lang.String getFromMemberHeadImage() {
		return this.fromMemberHeadImage;
	}
	public void setFromMemberNickName(java.lang.String value) {
		this.fromMemberNickName = value;
	}
	
	public java.lang.String getFromMemberNickName() {
		return this.fromMemberNickName;
	}
	public void setToMemberId(java.lang.Integer value) {
		this.toMemberId = value;
	}
	
	public java.lang.Integer getToMemberId() {
		return this.toMemberId;
	}
	public void setToMemberHeadImage(java.lang.String value) {
		this.toMemberHeadImage = value;
	}
	
	public java.lang.String getToMemberHeadImage() {
		return this.toMemberHeadImage;
	}
	public void setToMemberNickName(java.lang.String value) {
		this.toMemberNickName = value;
	}
	
	public java.lang.String getToMemberNickName() {
		return this.toMemberNickName;
	}
	public void setFromIsValid(java.lang.Integer value) {
		this.fromIsValid = value;
	}
	
	public java.lang.Integer getFromIsValid() {
		return this.fromIsValid;
	}
	public void setToIsValid(java.lang.Integer value) {
		this.toIsValid = value;
	}
	
	public java.lang.Integer getToIsValid() {
		return this.toIsValid;
	}
	public String getSendDateString() {
		return DateConvertUtils.format(getSendDate(), FORMAT_SEND_DATE);
	}
	public void setSendDateString(String value) {
		setSendDate(DateConvertUtils.parse(value, FORMAT_SEND_DATE,java.util.Date.class));
	}
	
	public void setSendDate(java.util.Date value) {
		this.sendDate = value;
	}
	
	public java.util.Date getSendDate() {
		return this.sendDate;
	}
	public void setIsRead(java.lang.Integer value) {
		this.isRead = value;
	}
	
	public java.lang.Integer getIsRead() {
		return this.isRead;
	}
	public void setMessageType(java.lang.Integer value) {
		this.messageType = value;
	}
	
	public java.lang.Integer getMessageType() {
		return this.messageType;
	}
	public void setActionType(java.lang.Integer value) {
		this.actionType = value;
	}
	
	public java.lang.Integer getActionType() {
		return this.actionType;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Mid",getMid())
			.append("MessageTitle",getMessageTitle())
			.append("MessageCont",getMessageCont())
			.append("FromMemberId",getFromMemberId())
			.append("FromMemberHeadImage",getFromMemberHeadImage())
			.append("FromMemberNickName",getFromMemberNickName())
			.append("ToMemberId",getToMemberId())
			.append("ToMemberHeadImage",getToMemberHeadImage())
			.append("ToMemberNickName",getToMemberNickName())
			.append("FromIsValid",getFromIsValid())
			.append("ToIsValid",getToIsValid())
			.append("SendDate",getSendDate())
			.append("IsRead",getIsRead())
			.append("MessageType",getMessageType())
			.append("ActionType",getActionType())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getMid())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof SmgMessage == false) return false;
		if(this == obj) return true;
		SmgMessage other = (SmgMessage)obj;
		return new EqualsBuilder()
			.append(getMid(),other.getMid())
			.isEquals();
	}
}

